<link rel="stylesheet" href="{{ url_for('static',filename='layui/css/layui.css',t='1483944306685') }}" media="all">
<link rel="stylesheet" href="{{ url_for('static',filename='layui/css/admin.css',t='1314') }}" media="all">
<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list"
     style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label">职位名称</label>
        <div class="layui-input-inline">
            {{ list_info.zwmc_name }}
        </div>
        <label class="layui-form-label">公司名称</label>
        <div class="layui-input-inline">
            {{ list_info.gsmc_name }}
        </div>
        <label class="layui-form-label">链接</label>
        <div class="layui-input-inline">
            <a href="{{ list_info.href }}" target="_parent" class="layui-btn layui-btn-sm layui-btn-warm">跳转查看<i
                    class="layui-icon">&#xe602;</i></a>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">最低薪资</label>
        <div class="layui-input-inline">
            <input type="text" name="min_zwyx" value="{{ list_info.min_zwyx }}" lay-verify="required"
                   placeholder="￥" autocomplete="off" class="layui-input">
        </div>
        <label class="layui-form-label">最高薪资</label>
        <div class="layui-input-inline">
            <input type="text" name="max_zwyx" value="{{ list_info.max_zwyx }}" lay-verify="required"
                   placeholder="￥" autocomplete="off" class="layui-input">
        </div>
        <label class="layui-form-label">招聘人数</label>
        <div class="layui-input-inline">
            <input type="number" name="zprs" value="{{ list_info.zprs }}" lay-verify="required"
                   placeholder="请输入招聘人数" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">城市</label>
        <div class="layui-input-inline">
            <select name="dd_id" id="zw_city">
                <option value="0">请选择</option>
                {% for city in cities %}
                    <option value="{{ city.id }}"
                            {% if city.id==list_info.dd_id %}selected{% endif %}>{{ city.dd_name }}</option>
                {% endfor %}
            </select>
        </div>
        <label class="layui-form-label">公司性质</label>
        <div class="layui-input-inline">
            <select name="gsxz_id" id="zw_gsxz">
                <option value="0">请选择</option>
                {% for item in gsxz %}
                    <option value="{{ item.id }}"
                            {% if item.id==list_info.gsxz_id %}selected{% endif %}>{{ item.gsxz_name }}</option>
                {% endfor %}
            </select>
        </div>
        <label class="layui-form-label">公司规模</label>
        <div class="layui-input-inline">
            <select name="gsgm_id" id="zw_gsgm">
                <option value="0">请选择</option>
                {% for item in gsgm %}
                    <option value="{{ item.id }}"
                            {% if item.id==list_info.gsgm_id %}selected{% endif %}>{{ item.gsgm_name }}</option>
                {% endfor %}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">学历</label>
        <div class="layui-input-inline">
            <select name="xl_id" id="zw_xl">
                <option value="0">请选择</option>
                {% for item in xl %}
                    <option value="{{ item.id }}"
                            {% if item.id==list_info.xl_id %}selected{% endif %}>{{ item.xl_name }}</option>
                {% endfor %}
            </select>
        </div>
        <label class="layui-form-label">工作经验</label>
        <div class="layui-input-inline">
            <select name="gzjy_id" id="zw_gzjy">
                <option value="0">请选择</option>
                {% for item in gzjy %}
                    <option value="{{ item.id }}"
                            {% if item.id==list_info.gzjy_id %}selected{% endif %}>{{ item.gzjy_name }}</option>
                {% endfor %}
            </select>
        </div>
        <label class="layui-form-label">公司行业</label>
        <div class="layui-input-inline">
            <select name="gshy_id" id="zw_gshy">
                <option value="0">请选择</option>
                {% for item in gshy %}
                    <option value="{{ item.id }}"
                            {% if item.id==list_info.gshy_id %}selected{% endif %}>{{ item.gshy_name }}</option>
                {% endfor %}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">大分类</label>
        <div class="layui-input-inline">
            <select name="zwlb_big_id" id="zw_zwlb_big" lay-filter="zwlbBigSelect">
                <option value="0">请选择</option>
                {% for item in zwlb_big %}
                    <option value="{{ item.id }}"
                            {% if item.id==list_info.zwlb_big_id %}selected{% endif %}>{{ item.zwlb_big_name }}</option>
                {% endfor %}
            </select>
        </div>
        <label class="layui-form-label">小分类</label>
        <div class="layui-input-inline">
            <select name="zwlb_id" id="zw_zwlb">
                <option value="0">请选择</option>
                {% for item in zwlb %}
                    <option value="{{ item.id }}"
                            {% if item.id==list_info.zwlb_id %}selected{% endif %}>{{ item.zwlb_name }}</option>
                {% endfor %}
            </select>
        </div>
        <label class="layui-form-label">发布日期</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" id="fbrq" placeholder="yyyy-MM-dd HH:mm:ss"
                   value="{{ list_info.fbrq }}" name="fbrq">
        </div>
    </div>
    <input type="hidden" name="id" value="{{ list_info.id }}">
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="button" lay-submit lay-filter="edit-list-form-submit" value="确认" class="layui-btn">
        </div>
    </div>
</div>
<script src="/static/layui/layui.js?t=1483944306685" charset="utf-8" type="text/javascript"></script>
<script>
    layui.use(['jquery', 'layer', 'element', 'table', 'form', 'laydate'], function () {
        var $ = layui.jquery, i = layui.view,
            element = layui.element,
            layer = layui.layer, table = layui.table, form = layui.form, laydate = layui.laydate;
        //常规用法
        laydate.render({
            elem: '#fbrq'
        });
        //监听提交
        form.on('submit(edit-list-form-submit)', function (data) {
            $.ajax({
                url: '{{ url_for('admin_edit_list',list_id=list_info.id) }}',
                data: data.field,
                type: 'post',
                dataType: 'json',
                success: function (returnData) {
                    if (returnData.status == 1) {
                        layer.msg('修改成功')
                    }
                    else {
                        layer.msg(returnData.info)
                    }
                }
            });
            return false;
        });
        // 大分类
        form.on('select(zwlbBigSelect)', function (data) {
            if (data.value != 0) {
                $.ajax({
                    url: '/get/zwlb/list',
                    data: {'zwlb': data.value},
                    dataType: 'json',
                    success: function (returnData) {
                        var zwlb_list = '<option value="0">请选择</option>';
                        $.each(returnData, function (index, item) {
                            zwlb_list = zwlb_list + '<option value="' + item.id + '">' + item.zwlb_name + '</option>'
                        });
                        $("#zw_zwlb").html(zwlb_list);
                        form.render('select')
                    }
                });
            }
        });
    });
</script>
